{% extends 'base.html' %}

{% block title %}我的技能 - 校园技能交换平台{% endblock %}

{% block content %}
<div class="d-flex justify-content-between align-items-center mb-4">
    <h2>我的技能</h2>
    <a href="{% url 'listings:skill_create' %}" class="btn btn-primary">
        <i class="bi bi-plus-lg"></i> 发布新技能
    </a>
</div>

<div class="row row-cols-1 row-cols-md-2 g-4">
    {% for skill in skills %}
    <div class="col">
        <div class="card h-100">
            <div class="card-body">
                <h5 class="card-title">
                    <a href="{% url 'listings:skill_detail' skill.pk %}" class="text-decoration-none">{{ skill.title }}</a>
                </h5>
                <p class="card-text text-truncate">{{ skill.description }}</p>
                <div class="d-flex justify-content-between align-items-center">
                    <small class="text-muted">{{ skill.get_category_display }}</small>
                    <small class="text-muted">{{ skill.get_reward_type_display }}</small>
                </div>
            </div>
            <div class="card-footer d-flex justify-content-between align-items-center">
                <small class="text-muted">发布时间: {{ skill.created_at|date:"Y-m-d" }}</small>
                <div>
                    <a href="{% url 'listings:skill_edit' skill.pk %}" class="btn btn-sm btn-outline-primary">编辑</a>
                </div>
            </div>
        </div>
    </div>
    {% empty %}
    <div class="col-12">
        <div class="alert alert-info" role="alert">
            您还没有发布任何技能。<a href="{% url 'listings:skill_create' %}" class="alert-link">立即发布</a>
        </div>
    </div>
    {% endfor %}
</div>
{% endblock %} 